package com.lsh.service;

import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lsh.common.util.PageSurport;
import com.lsh.dao.TbPosRecodeDao;
import com.lsh.model.TbPosRecode;

@Service("tbPosRecodeService")
public class TbPosRecodeService extends BasicService {

	private static final Log LOG = LogFactory.getLog(TbBackRecordService.class);
	@Autowired
	TbPosRecodeDao dao;

	/**
	 * 插入数据
	 * @param posRecode
	 * @return
	 */
	public int insert(TbPosRecode posRecode) {
		return dao.insert("TbPosRecode-insert", posRecode);
	}

	/**
	 * 根据ID获取记录
	 * @param posRecode
	 * @return
	 */
	public TbPosRecode getById(String no) {
		return dao.getById("TbPosRecode-getById", no);
	}

	/**
	 * 删除记录
	 * @param object
	 * @return
	 */
	public int delete(TbPosRecode posRecode) {
		return dao.delete("TbPosRecode-delete", posRecode);
	}
	
	/**
	 * 删除记录
	 * @param object
	 * @return
	 */
	public int update(TbPosRecode posRecode) {
		return dao.update("TbPosRecode-update", posRecode);
	}
	/**
	 * 获取分页数据
	 * @param map
	 * @param page
	 * @return
	 */
	public PageSurport getPage(Map map, PageSurport page) {
		return dao.selectPageByPage("TbPosRecode-getPage",
				"TbPosRecode-getPageCount", page, map);
	}

	/**获取全部记录
	 * @param orderBy
	 * @return
	 */
	public List getAll(String orderBy) {
		return dao.selectAll("TbPosRecode-getAll", orderBy);
	}

	public List<TbPosRecode> selectPosBy() {
		return dao.selectPosBy();
	}

}
